'''
Author: kun 56216004@qq.com
Date: 2024-07-31 17:37:05
LastEditors: kun 56216004@qq.com
LastEditTime: 2024-07-31 17:48:02
FilePath: \langchain\modelScope.py
Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
'''
# 模型的上传 · 文档中心  https://modelscope.cn/docs/%E6%A8%A1%E5%9E%8B%E7%9A%84%E4%B8%8A%E4%BC%A0

from modelscope.hub.api import HubApi

YOUR_ACCESS_TOKEN = 'e6841ed7-78f5-4e50-919d-9512254f5c4c'

api = HubApi()
api.login(YOUR_ACCESS_TOKEN)
api.push_model(
    model_id="ovjust/ollama026", 
    model_dir=r"D:\\1download\\ollama\\"
    # model_dir=r"D:\\1MyFiles\\code\\python\\ollama026\\"    # 本地模型目录，要求目录中必须包含configuration.json
)

#  stderr: fatal: A branch named 'master' already exists.
# 2024-07-31 17:44:44,811 - modelscope - ERROR - git lfs is not installed, please install.